package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 云剑·回首
 */
@Component
public class Yun_HuiShou extends SwordCard {
    protected int heal;

    /**
     * 云剑·回首
     */
    public Yun_HuiShou(@Value("1") int lvl) {
        super("云剑·回首");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("防+8/11/14 连云：生命+3/5/7");
        this.setCardType(CardType.YUN);
        if (1 == lvl) {
            this.setLevel(1);
            this.setShield(8);
            this.heal = 3;
        } else if (2 == lvl) {
            this.setLevel(2);
            this.setShield(11);
            this.heal = 5;
        } else if (3 == lvl) {
            this.setLevel(3);
            this.setShield(14);
            this.heal = 7;
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addShield(this.getShield());
        if(Sta1.lastIs(CardType.YUN)){
            Sta1.heal(this.heal);
        }
        return true;
    }
}
